/***************************************************************
 *
 * Filename：Filerswindow.cpp
 * Abstract：the design of file window
 * version ：1.0
 *
 * Copyright (c) 2011 SCUT DT&P FY&XC
 *
***************************************************************/

#include "Filerswindow.h"

FileRSWindow::FileRSWindow()
{
    //TCPSAddr = addr;
    initialize();
}

//初始化
void FileRSWindow::initialize()
{
    //resize(360,220);
    //setMinimumSize(360,220);
    //setMaximumSize(360,220);

    fileWindow = new QWidget(this);
    fileWindow->resize(550,180);
    text = new QLabel();
    text->setAlignment(Qt::AlignCenter);
    progressLabel = new QLabel();
    progressLabel->setAlignment(Qt::AlignCenter);
    progressBar = new QProgressBar();
    progressBar->setAlignment(Qt::AlignCenter);
    progressBar->reset();

    QVBoxLayout *basilayout = new QVBoxLayout();
    basilayout->addSpacing(10);
    basilayout->addWidget(text);
    basilayout->addSpacing(10);
    basilayout->addWidget(progressBar);
    basilayout->addSpacing(10);
    basilayout->addWidget(progressLabel);

    fileWindow->setLayout(basilayout);
    fileWindow->setVisible(false);

}

//更新提示文本内容
void FileRSWindow::setlabeltext(QString txt)
{
    text->setText(txt);
}

//更新进度数据内容
void FileRSWindow::setProgresstext(QString txt)
{
    progressLabel->setText(txt);
}

//更新进度条
void FileRSWindow::setProgressBar(qint64 max,qint64 value)
{
    progressBar->setMaximum(max);
    progressBar->setValue(value);
}
